package com.lianyu507.task;

import com.lianyu507.pojo.DtOperationLog;

import java.util.Date;

/**
 * =================================
 * <p>
 * Created by Administrator on 2017/11/22.
 * <p>
 * 描述:
 */

public class CreateLog {

    /**
     * 创建操作日志
     */

    public static DtOperationLog createOperationLog(byte isadmin, Integer userId, String ip, String message, byte referenceType, Integer referenceId) {
        DtOperationLog dtOperationLog = new DtOperationLog();
        Date date = new Date();
        dtOperationLog.setLogName("操作日志");
        dtOperationLog.setUserId(userId);
        dtOperationLog.setIsAdmin(isadmin);
        dtOperationLog.setCreateTime(date);
        dtOperationLog.setIp(ip);
        dtOperationLog.setMessage(message);
        dtOperationLog.setUpdateTime(date);
        // 日志正常为1,删除为0
        dtOperationLog.setStatus((byte) 1);
        dtOperationLog.setReferenceType(referenceType);
        dtOperationLog.setReferenceId(referenceId);
        return dtOperationLog;
    }

}
